﻿// -----------------------------------------------------------------------------
// Generate By Furion Tools v3.0.6                            
// -----------------------------------------------------------------------------

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using HOPU.OnlineSchool.Core;

namespace HOPU.OnlineSchool.Core
{
    public partial class EduVideo : IEntity<MasterDbContextLocator>, IEntityTypeBuilder<EduVideo, MasterDbContextLocator>
    {
    
        public string Id { get; set; }
        public string CourseId { get; set; }
        public string ChapterId { get; set; }
        public string Title { get; set; }
        public string VideoSourceId { get; set; }
        public string VideoOriginalName { get; set; }
        public int Sort { get; set; }
        public long PlayCount { get; set; }
        public byte IsFree { get; set; }
        public float Duration { get; set; }
        public string Status { get; set; }
        public long Size { get; set; }
        public long Version { get; set; }
        public DateTime GmtCreate { get; set; }
        public DateTime GmtModified { get; set; }
    
        public void Configure(EntityTypeBuilder<EduVideo> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
                entityBuilder.ToTable("edu_video");

                entityBuilder.HasComment("课程视频");

                entityBuilder.HasIndex(e => e.ChapterId, "idx_chapter_id");

                entityBuilder.HasIndex(e => e.CourseId, "idx_course_id");

                entityBuilder.Property(e => e.Id)
                    .HasMaxLength(19)
                    .HasColumnName("id")
                    .IsFixedLength(true)
                    .HasComment("视频ID");

                entityBuilder.Property(e => e.ChapterId)
                    .IsRequired()
                    .HasMaxLength(19)
                    .HasColumnName("chapter_id")
                    .IsFixedLength(true)
                    .HasComment("章节ID");

                entityBuilder.Property(e => e.CourseId)
                    .IsRequired()
                    .HasMaxLength(19)
                    .HasColumnName("course_id")
                    .IsFixedLength(true)
                    .HasComment("课程ID");

                entityBuilder.Property(e => e.Duration)
                    .HasColumnName("duration")
                    .HasComment("视频时长（秒）");

                entityBuilder.Property(e => e.GmtCreate)
                    .HasColumnName("gmt_create")
                    .HasComment("创建时间");

                entityBuilder.Property(e => e.GmtModified)
                    .HasColumnName("gmt_modified")
                    .HasComment("更新时间");

                entityBuilder.Property(e => e.IsFree)
                    .HasColumnName("is_free")
                    .HasComment("是否可以试听：0收费 1免费");

                entityBuilder.Property(e => e.PlayCount)
                    .HasColumnType("bigint unsigned")
                    .HasColumnName("play_count")
                    .HasComment("播放次数");

                entityBuilder.Property(e => e.Size)
                    .HasColumnType("bigint unsigned")
                    .HasColumnName("size")
                    .HasComment("视频源文件大小（字节）");

                entityBuilder.Property(e => e.Sort)
                    .HasColumnType("int unsigned")
                    .HasColumnName("sort")
                    .HasComment("排序字段");

                entityBuilder.Property(e => e.Status)
                    .IsRequired()
                    .HasMaxLength(20)
                    .HasColumnName("status")
                    .HasDefaultValueSql("'Empty'")
                    .HasComment("Empty未上传 Transcoding转码中  Normal正常");

                entityBuilder.Property(e => e.Title)
                    .IsRequired()
                    .HasMaxLength(50)
                    .HasColumnName("title")
                    .HasComment("节点名称");

                entityBuilder.Property(e => e.Version)
                    .HasColumnType("bigint unsigned")
                    .HasColumnName("version")
                    .HasDefaultValueSql("'1'")
                    .HasComment("乐观锁");

                entityBuilder.Property(e => e.VideoOriginalName)
                    .HasMaxLength(100)
                    .HasColumnName("video_original_name")
                    .HasComment("原始文件名称");

                entityBuilder.Property(e => e.VideoSourceId)
                    .HasMaxLength(100)
                    .HasColumnName("video_source_id")
                    .HasComment("云端视频资源");
        }

    }
}
